home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / MacHacksBug / Python 1.5.2c1 / Tools / idle / Bindings.py < prev    next >
Encoding:
Text File  |  2000-06-23  |  1.7 KB  |  60 lines

  1. # This file defines the menu contents and key bindings.  Note that
  2. # there is additional configuration information in the EditorWindow
  3. # class (and subclasses): the menus are created there based on the
  4. # menu_specs (class) variable, and menus not created are silently
  5. # skipped by the code here.  This makes it possible to define the
  6. # Debug menu here, which is only present in the PythonShell window.
  7.  
  8. import sys
  9. import string
  10. from keydefs import *
  11.  
  12. menudefs = [
  13.  # underscore prefixes character to underscore
  14.  ('file', [
  15.    ('_New window', '<<open-new-window>>'),
  16.    ('_Open...', '<<open-window-from-file>>'),
  17.    ('Open _module...', '<<open-module>>'),
  18.    ('Class _browser', '<<open-class-browser>>'),
  19.    ('_Path browser', '<<open-path-browser>>'),
  20.    ('Python shell', '<<open-python-shell>>'),
  21.    None,
  22.    ('_Save', '<<save-window>>'),
  23.    ('Save _As...', '<<save-window-as-file>>'),
  24.    ('Save Co_py As...', '<<save-copy-of-window-as-file>>'),
  25.    None,
  26.    ('_Close', '<<close-window>>'),
  27.    ('E_xit', '<<close-all-windows>>'),
  28.   ]),
  29.  ('edit', [
  30.    ('_Undo', '<<undo>>'),
  31.    ('_Redo', '<<redo>>'),
  32.    None,
  33.    ('Cu_t', '<<Cut>>'),
  34.    ('_Copy', '<<Copy>>'),
  35.    ('_Paste', '<<Paste>>'),
  36.    ('Select _All', '<<select-all>>'),
  37.   ]),
  38.  ('script', [
  39.    ('Run module', '<<run-module>>'),
  40.    ('Run script', '<<run-script>>'),
  41.    ('New shell', '<<new-shell>>'),
  42.   ]),
  43.  ('debug', [
  44.    ('_Go to file/line', '<<goto-file-line>>'),
  45.    ('_Stack viewer', '<<open-stack-viewer>>'),
  46.    ('!_Debugger', '<<toggle-debugger>>'),
  47.    ('!_Auto-open stack viewer', '<<toggle-jit-stack-viewer>>' ),
  48.   ]),
  49.  ('help', [
  50.    ('_Help...', '<<help>>'),
  51.    None,
  52.    ('_About IDLE...', '<<about-idle>>'),
  53.   ]),
  54. ]
  55.  
  56. if sys.platform == 'win32':
  57.     default_keydefs = windows_keydefs
  58. else:
  59.     default_keydefs = unix_keydefs
  60.